package com.zang.linkedlist;

/**
 * @author ZVerify
 * @since 2022/10/10 18:44
 **/
public class 移除链表元素 {

    public ListNode removeElements(ListNode head, int val) {

        if (head==null) return null;

        head.next = removeElements(head.next,val);
        return head.val == val ? head.next : head;
    }
}
